/*
 *------------------------------------------------------------------------------
 * @File      :    ei_mai_nna.h
 * @Date      :    2021-4-8
 * @Author    :    lomboswer <lomboswer@lombotech.com>
 * @Brief     :    Media Interface for MADP(Media Development Platform).
 *
 * Copyright (C) 2020-2021, LomboTech Co.Ltd. All rights reserved.
 *------------------------------------------------------------------------------
 */

#ifndef __EI_NNA_DEFINE_H__
#define __EI_NNA_DEFINE_H__

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include "ei_type.h"

#define NNA_MODEL_ROOTPATH_LEN (256)
#define DEFAULT_NNA_MODEL_ROOTPATH "/usr/share/ax"

#define DEFAULT_NNA_CONFIG_FRAME_WIDTH (1920)
#define DEFAULT_NNA_CONFIG_FRAME_HEIGHT (1080)
#define DEFAULT_NNA_CONFIG_AX_DEVID (0)
#define DEFAULT_NNA_CONFIG_AX_FREQ (650)

typedef enum eiNNA_PIXEL_FORMAT_E {
	EI_NNA_FORMAT_420 = 0, //NV12
} EI_NNA_FORMAT_E;

typedef struct eiNNA_ISP_DATA_S {
	EI_U32 u32ExposureTime;
	EI_U32 u32ISOSpeed;
	EI_U32 u32AvgLum;
} EI_NNA_ISP_DATA_S;

typedef struct eiNNA_ROI_DATA_S {
	EI_U32 s32Rect[4];
} EI_NNA_ROI_DATA_S;

typedef struct eiNNA_FRAME_DATA_S {
	EI_U32					u32Width;
	EI_U32					u32Height;
	EI_U32					u32WStride;
	EI_NNA_FORMAT_E			enPixelFormat;
	EI_U32					u32PhyAddr[3];
	EI_U32					pVirAddr[3];
	EI_U32					u32Size[3];
	EI_NNA_ISP_DATA_S		stIsp;
	//stRoi roi区域的宽高比例要与 u32Width / u32Height 比例差不多
	EI_NNA_ROI_DATA_S		stRoi;
} EI_NNA_FRAME_DATA_S;

typedef struct eiNNA_AUDIO_FRAME_S {
	EI_U8  *u64VirAddr;
	EI_U64  u64PhyAddr;
	EI_U64  u64TimeStamp;
	EI_U32  u32Seq;
	EI_U32  u32Len;
	EI_U32  u32LenValid;
} EI_NNA_AUDIO_FRAME_S;

typedef struct eiNNA_AX_FREQ_S {
	/*dev_id; freq*/
	EI_S32 s32DevId; // usually is 0
	EI_S32 s32Freq; // range [100 - 650]
} EI_NNA_AX_FREQ_S;

typedef EI_NNA_FRAME_DATA_S EI_NNA_SRC_FRAME_S;

#ifdef __cplusplus
}
#endif

#endif
